_Pragma("once")

#include "LoggerBase.h"
#include "logger.h"

/**
author lizaibing

*/



#define USE_LOGGER LoggerImplement::IMP_BY_LOG4C


#ifdef USE_LOGGER

typedef Logger<USE_LOGGER> UsedLogger;

extern UsedLogger logHandle;

extern UsedLogger BizLogHandle;

#define LOG_TO(handle, level, ...)   handle.log(level, __VA_ARGS__)


#define LOG_DEDUG(...) LOG_TO(logHandle, UsedLogger::DEBUG, __VA_ARGS__)
#define LOG_INFO(...) LOG_TO(logHandle, UsedLogger::INFO, __VA_ARGS__)
#define LOG_WARN(...) LOG_TO(logHandle, UsedLogger::WARN, __VA_ARGS__)
#define LOG_ERROR(...) LOG_TO(logHandle, UsedLogger::ERROR, __VA_ARGS__)
//#define LOG_ERROR(format, ...) printf(format, __VA_ARGS__)
#define LOG_FATAL( ...) LOG_TO(logHandle, UsedLogger::FATAL, __VA_ARGS__)






#else

#define LOG_TO(logHandle, level, format, ...)
//printf(format, __VA_ARGS__)

#define LOG_DEDUG(format, ...) LOG_TO(logHandle, level, format, __VA_ARGS__)
#define LOG_INFO(format, ...) LOG_TO(logHandle, level, format, __VA_ARGS__)
#define LOG_WARN(format, ...) LOG_TO(logHandle, level, format, __VA_ARGS__)
#define LOG_ERROR(format, ...) LOG_TO(logHandle, level, format, __VA_ARGS__)
#define LOG_FATAL(format, ...) LOG_TO(logHandle, level, format, __VA_ARGS__)




#endif // USE_LOGGER


#define BIZ_PREFIX(format) "BIZ-" format



